//
//  ViewerBase.h
//

#import <Cocoa/Cocoa.h>

#import "PhotoBase.h"


@class ImageView;
@class ThumbnailView;
@class QTMovieView;

enum 
{
	TVS_HIDDEN = 0,
	TVS_TOP,
	TVS_BOTTOM,
	TVS_LEFT,
	TVS_RIGHT,
};


@interface ViewerBase : PhotoBase
{
    IBOutlet ImageView		*imageView;
	IBOutlet ThumbnailView	*thumbView;
	IBOutlet QTMovieView	*movieView;


	// From the TVS_* enums: hidden, top, bottom, left, right
	int				thumbViewState;

	// The height/width of the thumbView, from IB - used to set the height/width
	// for the thumbView when it's moved around.
	int				thumbViewMax;

	BOOL			showName;
	BOOL			showDate;
	BOOL			showFileLength;
	BOOL			showImageSize;
	BOOL			showIndex;

	// YES: shrink the image to fit the window; NO: display the image at its
	// native size, enabling the scrollbars, if needed.
	BOOL			fitWindow;

	// YES: Show the movie at its natural size; NO: fill the view with the movie.
	BOOL			movieNaturalSize;

	BOOL			fullScreen;
	NSWindow		*fullScreenWindow;
	NSWindow		*originalWindow;

	// Number of path elements to use when displaying the filename (0 is just the
	// filename, 1 includes the parent and so on).
	int				pathElements;

	NSColor			*originalColor;
}

- (IBAction) cancelFullScreen:(id)sender;
- (IBAction) toggleFullScreen:(id)sender;
- (IBAction) toggleOriginalSize:(id)sender;

//--------------------------------------------------------------------------------------------------
// To be implemented by sub-classes

// Redraw the current file
- (void) redrawCurrent;



//--------------------------------------------------------------------------------------------------
- (void) endFullScreenDuringClose;
- (void) setThumbViewState:(int)newState;

- (BOOL) displayFile:(ThumbData *) td;
- (BOOL) displayImage:(NSString*) filename;
- (BOOL) displayMovie:(NSString*) filename;
- (void) fitImage;

- (void) prefsDataChanged:(NSNotification*) note;


- (NSString*) currentFile;
- (NSString*) currentFolder;


- (NSWindow*) mainWindow;
- (int) sortBy;
- (BOOL) hasDirectory;
- (BOOL) hasSelectedJPEG;
- (BOOL) hasSelectedImage;

- (void) calcAndSetMovieFrame;
- (void) movieSuperViewFrameChanged: (NSNotification *) notification;
- (void) setImageStrings:(NSString *) fullFilename   index:(int) index
	totalCount:(int) totalCount   date:(NSDate*) date;

- (void) setIsAlreadyFullScreen;

@end
